package com.itheima.chapter12.classLoader;

import sun.net.spi.nameservice.dns.DNSNameService;

public class ClassLoaderDemo {
    public static void main(String[] args) {
        //BostStrap ClassLoader  启动类加载器
        ClassLoader classLoader1 = String.class.getClassLoader();
        System.out.println(classLoader1);
        //Platform ClassLoader  平台类加载器

        //Extension ClassLoader  扩展类加载器
        ClassLoader classLoader2 = DNSNameService.class.getClassLoader();
        System.out.println(classLoader2);
        //Application ClassLoader  系统类加载器
        ClassLoader classLoader3 = ClassLoaderDemo.class.getClassLoader();
        System.out.println(classLoader3);
        //上下级关系
        System.out.println("Platform ClassLoader  平台类加载器");
        ClassLoader parent = classLoader3.getParent();
        System.out.println(parent);
        System.out.println(classLoader3.getParent().getParent());
    }
}
